import { DataTypes } from 'sequelize';

import {
  Mysql,
} from '@/db/mysql.db';

const DemoUsers = Mysql.define('Users', {
  account: {
    type: DataTypes.STRING,
    unique: true,
    allowNull: false,
    comment: '用户账号',
  },
  email: {
    type: DataTypes.STRING,
    unique: true,
    comment: '用户邮箱',
  },
  phone: {
    type: DataTypes.STRING(20),
    unique: true,
    comment: '用户手机号',
  },
  password: {
    type: DataTypes.TEXT,
    allowNull: false,
    comment: '用户密码',
  },
  nickname: {
    type: DataTypes.STRING,
    comment: '用户昵称',
  },
  age: {
    type: DataTypes.INTEGER,
    comment: '用户年龄',
  },
  sex: {
    type: DataTypes.INTEGER,
    comment: '用户性别: 0代表女, 1代表男, 2代表未设置',
    defaultValue: 2,
  },
});

export default DemoUsers;
